@import '~components/constants.scss';

/* Dropmenu */

.menu-list {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 0;

  &.inline,
  &.inline.as_frame {
    width: 100%;
    position: absolute;
    top: 100%;
    z-index: 1000;

    &.top {
      bottom: 100%;
      top: auto;
      display: flex;
      flex-direction: column-reverse;

      &::before {
        height: calc(100% + 34px);
        top: 0;
      }
    }
  }

  &.as_frame {
    border-radius: var(--default-border-radius);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05), 0 0 20px 0 rgba(0, 0, 0, 0.15);
    background-color: $white;
    width: 250px;
    max-height: 80vh;
    overflow: auto;
  }

  .menu-title {
    height: 32px;
    line-height: 32px;
    font-size: 14px;
    font-weight: bold;
    color: $black;
    margin: 0 8px;
    padding: 0 8px;
  }

  .menu-text {
    font-size: 12px;
    font-weight: 500;
    margin: 8px 8px;
    padding: 0 8px;
    color: $grey_dark;
  }

  .menu-custom {
    font-size: 12px;
    font-weight: 500;
    margin: 8px 8px;
    padding: 0 8px;

    .menu-cancel-margin,
    &.menu-cancel-margin {
      margin: -8px 0;
      width: 100%;
      padding: 0;

      & > .menu,
      & > .menu-text,
      & > .menu-custom,
      & > .menu-title {
        margin: -8px 0;
      }
    }
  }

  .menu {
    height: 32px;
    line-height: 32px;
    font-size: 14px;
    color: $black;
    margin: 0 8px;
    padding: 0 8px;
    border-radius: var(--default-border-radius);
    font-weight: 500;
    display: flex;
    overflow: hidden;
    &:not(.no-background) {
      cursor: pointer;
    }

    &.no-background {
      background: transparent !important;
      &:hover {
        color: $black;
      }
    }

    &.selected,
    &.selected:hover,
    &.is_selected,
    &.is_selected:hover {
      background: $primary;
      color: $white;
      .icon {
        color: $white;
      }
    }

    &:hover {
      background: $grey_background;
      color: $primary;
      .icon {
        color: $primary;
      }
    }

    &.primary {
      color: $primary;
      .icon {
        color: $primary;
      }
    }

    &.error,
    &.danger {
      color: $red;
      .icon {
        color: $red;
      }
    }
  }

  .menu-custom,
  .menu {
    .icon {
      display: flex;
      align-items: center;
      width: 30px;
      font-size: 18px;
      margin-left: -5px;
      color: $grey_dark;
      align-items: center;
      justify-content: center;

      .emoji-container {
        height: 28px;
      }

      .user_head {
        margin-left: 5px;
        border: 0;
      }

      .letter {
        font-size: 10px;
        width: 16px;
        height: 16px;
        text-align: center;
        line-height: 16px;
        border-radius: var(--default-border-radius);
        font-weight: 500;
        margin-left: 5px;
        background: $grey_dark;
        color: $grey_light;
      }

      .emojione {
        width: 16px;
        height: 16px;
        margin-left: 5px;
        margin-top: -2px;
      }

      .emoji-image {
        margin-top: 0px;
        border-radius: var(--default-border-radius);
      }
    }

    .image {
      width: 24px;
      height: 24px;
      border-radius: var(--default-border-radius);
      background-color: $grey_dark;
      display: inline-block;
      background-size: contain;
      background-position: center;
      margin-right: 5px;
      box-sizing: border-box;
      vertical-align: middle;
      line-height: 24px;
      text-align: center;
      color: $secondary;
      &.has_image {
        font-size: 0px;
      }
    }

    .text {
      flex: 1;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .more {
      width: 18px;
      font-size: 18px;
      display: flex;
      align-items: center;
      height: 32px;
    }
  }

  .menu-separator {
    border-top: 1px solid $grey_light;
    height: 8px;
    margin-top: 8px;
    width: auto;
    margin-left: 8px;
    margin-right: 8px;
  }
  &.as_frame {
    .menu-separator {
      width: 100%;
      margin-left: 0px;
      margin-right: 0px;
    }
  }
}
